<?php

namespace app\common\model;
use think\Model;


class Personnel extends Model
{
    protected $autoWriteTimestamp = true;

    public function setPasswordAttr($value)
    {
        return md5($value);
    }
    //班级
    public function getMenuCopy1(){
        return $this->hasOne('\app\common\model\Grade','id','grade');
    }
//    //积分
//    public function getIntegral(){
//        return $this->hasOne('\app\common\model\Integral','user','integral');
//    }
    //职位
    public function getPosition(){
        return $this->hasOne('\app\common\model\Position','id','position_id');
    }
}